//
// Created by bbnf on 09.06.2024.
//

#ifndef TODOAPPCPP_STORAGE_LOGGER_H
#define TODOAPPCPP_STORAGE_LOGGER_H

#include <spdlog/spdlog.h>

#define LOG_LEVEL_TRACE spdlog::level::trace
#define LOG_LEVEL_DEBUG spdlog::level::debug
#define LOG_LEVEL_INFO spdlog::level::info
#define LOG_LEVEL_WARN spdlog::level::warn
#define LOG_LEVEL_ERROR spdlog::level::error
#define LOG_LEVEL_CRITICAL spdlog::level::critical

#ifdef NDEBUG
#define LOG_LEVEL(...)
#define LOG_TRACE(...)
#define LOG_DEBUG(...)
#define LOG_INFO(...)
#define LOG_WARN(...)
#define LOG_ERROR(...)
#define LOG_CRITICAL(...)
#else
#define LOG_LEVEL(...) spdlog::set_level(__VA_ARGS__)
#define LOG_TRACE(...) spdlog::trace(__VA_ARGS__)
#define LOG_DEBUG(...) spdlog::debug(__VA_ARGS__)
#define LOG_INFO(...) spdlog::info(__VA_ARGS__)
#define LOG_WARN(...) spdlog::warn(__VA_ARGS__)
#define LOG_ERROR(...) spdlog::error(__VA_ARGS__)
#define LOG_CRITICAL(...) spdlog::critical(__VA_ARGS__)
#endif // NDEBUG

#endif //TODOAPPCPP_STORAGE_LOGGER_H
